package com.hyy.libray.presenter;

import java.lang.ref.WeakReference;

public class BasePresenter<V> implements IBasePresenter<V> {

    public WeakReference<V> mWeakReference;

    @Override
    public void onttach(V t) {
        mWeakReference = new WeakReference(t);
    }

    @Override
    public void dettach() {
        mWeakReference.clear();
    }


    public V getIView() {
        if (mWeakReference.get() != null) {
            return mWeakReference.get();
        }
        return null;
    }


}
